const express = require('express');
const router = express.Router();

// V2 Controllers
const userController = require('../../modules/user/v2/user.controller');

/**
 * API Version 2.0 Routes
 * Current stable API version
 */

// Version info endpoint
router.get('/', (req, res) => {
  res.json({
    version: '2.0',
    status: 'stable',
    message: 'API v2 - Current stable version',
    releaseDate: '2024-01-01',
    features: [
      'Enhanced user management',
      'Improved error handling',
      'Better authentication flow',
      'Standardized response format'
    ],
    documentation: '/docs/api/v2'
  });
});

// User routes
router.use('/users', userController);

// Add version headers for all v2 routes
router.use('*', (req, res, next) => {
  res.set({
    'X-API-Version': '2.0',
    'X-API-Status': 'stable'
  });
  next();
});

module.exports = router;